package payment

type PaymentType int

const (
	AlipayType = "alipay"
	WechatTYpe = "wechat"
)

// 支付工厂结构体
type PaymentFactory struct{}

// 创建支付实例
func (pf *PaymentFactory) Create(payType string, config Config, extra interface{}) Payment {
	switch payType {
	case AlipayType:
		return NewAliPay(config, extra.(string))
	case WechatTYpe:
		return NewWechatPay(config, extra.(string))
	default:
		panic("unsupport payment type: ")

	}
}
